FROM --platform=linux/amd64 node:18.18.2-buster-slim AS builder

WORKDIR /app
COPY . .
 RUN npm install --registry=https://registry.npmmirror.com && npm run build:docker

FROM --platform=linux/amd64 nginx:latest AS server
COPY --from=builder  /app/dist/ /usr/share/nginx/html/
COPY --from=builder   /app/nginx-docker/default.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
RUN /bin/cp  /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' > /etc/timezone
ENV LANG C.UTF-8

CMD ["nginx","-g","daemon off;"]


#docker build -t nginx_vue .
#docker run -d --restart always -p 80:80 --name ruoyiwms-vue nginx_vue:latest


